package com.spring.security.web.model;

import java.io.Serializable;

public class BaseResult implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	// 返回码，0表示成功，非0表示失败
//    private HttpStatus status;
	private String status;

    // 返回消息，成功为“success”，失败为具体失败信息
    private String msg;

    // 返回数据
    private Object dataset;
    
    public int getCount() {
		return count;
	}

	public void setCount(int count) {
		this.count = count;
	}

	private int count;
    
    public BaseResult(String resultCode, String resultMessage, Object resultData,int count) {
        this.status = resultCode;
        this.msg = resultMessage;
        this.dataset = resultData;
        this.count=count;
    }
    
    public BaseResult(String resultCode, String resultMessage, Object resultData) {
        this.status = resultCode;
        this.msg = resultMessage;
        this.dataset = resultData;
    }

    public BaseResult(String resultCode, String resultMessage) {
        this.status = resultCode;
        this.msg = resultMessage;
    }
    
    public BaseResult(Object dataset) {
        this.dataset = dataset;
    	this.status = "1";
    	this.msg = "操作成功";
    }

    public BaseResult()
    {
    	this.status = "1";
    	this.msg = "操作成功";
    }

    @Override
    public String toString() {
        return "BaseResult{" +
                "resultCode=" + status +
                ", resultMessage='" + msg + '\'' +
                ", resultData=" + dataset +
                '}';
    }

	public String getStatus() {
		return status;
	}

	public BaseResult setStatus(String status) {
		this.status = status;
		return this;
	}

	public String getMsg() {
		return msg;
	}

	public BaseResult setMsg(String msg) {
		this.msg = msg;
		return this;
	}

	public Object getDataset() {
		return dataset;
	}

	public BaseResult setDataset(Object dataset) {
		this.dataset = dataset;
		return this;
	}
}
